#ifndef __ROOM_HPP__
#define __ROOM_HPP__

#include "fastdo.hpp"
#include "user.hpp"
#include "utils.hpp"
#include "ownership_object.hpp"

class ProtocolObjectRoom;
class Protocol;

class Room
{
public:
    Room();
    int id = 0;
    winux::String owner = "";
    unsigned int totalDataTime = 0;
    winux::String totalData = "";
    std::vector<User *> userList;
    std::vector<winux::SharedPointer<OwnershipObject>> ownershipObjectList;

    bool hasUser(User *user);
    void userEnter(User *user);
    void userLeave(User *user);
    void dispatch(Protocol *msg, User *sender = nullptr);
    winux::SimplePointer<ProtocolObjectRoom> toProtocol();
};

#endif //__ROOM_HPP__